<?php
$ap = AppModel\Application::create();
$ap->DesiredAmount = 5003;
$ap->app_id = uniqid();
$ap->save();
$ct = AppModel\Application\Applicant::create();
$ct->{$ct->getDataModel()->idField} = uniqid();
$ct->FirstName = 'test3';
$ct->SurName = 'aaaa4';
$ct->Dependant = 1;
//$ap->Applicant()->save($ct);
//$ct->Application()->associate($ap);
$ct->{$ct->masterKey} = $ap->app_id;
$ct->save();
var_dump($ct->getAttributes());
var_dump($ap->getAttributes());

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

